import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  base: './',
  server: {
    port: 7003,
    proxy: {
      '^/apiProxy': {
        // target: 'http://127.0.0.1:8000/stock-api',
        target: 'https://zsjxc888.com/apiProxy',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/apiProxy/, '')
      },
      '^/futures': {
        target: 'https://stock2.finance.sina.com.cn/futures',
        // target: 'http://120.76.117.159:8081/stock-api',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/futures/, '')
      }
    }
  },
  build: {
  }
})
